#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,x,y,z;
	cin>>a>>b;
	if(a<100)a=100;
	if(b>999)b=999; 
	int i=a;
	//i>b i>=b i<b i<=b
    while(i<=b){
        x=i/100;
    	y=i%100/10;
    	z=i%10;
    	if(i==x*x*x+y*y*y+z*z*z)cout<<i<<endl;
    	i++;
    	
    }
	return 0;
}
